Paradigm(s) | object-oriented |
---|---|
Appeared in | 2010 |
Designed by | Christopher Bertels |
Developer | Christopher Bertels |
Typing discipline | strong, dynamic |
Influenced by | Smalltalk,[1] Ruby,[1] Erlang,[1] Io[1] |
OS | Unix-like (including Mac OS X and Linux) |
License | BSD license |
Usual filename extensions | .fy, .fyc, .fancypack |
Website | www.fancy-lang.org |
Fancy is a pure object-oriented programming language that is heavily influenced by Smalltalk and Ruby. The language is currently under development as an open source project by Christopher Bertels.[1]
Contents |
The language has been in development since the beginning of 2010 and has changed from a C++-based interpreter to be running on Rubinius, a dynamic bytecode virtual machine and implementation for the Ruby programming language.[2]. Thus Fancy supports seamless integration with Ruby and any Ruby libraries.
Fancy is a dynamic programming language,[1] meaning that it will execute tasks at runtime that many languages would perform during compilation. Fancy is a garbage-collected language, like Java or Ruby.[3] The goals of Fancy as a programming language are to be easily understandable by programming beginners, and to perform well enough to be used as a scripting language in Unix environments.[4]
Fancy is implemented on top of Rubinius, the Ruby VM, and therefore integrates well with Ruby.[4] Since Fancy is built on Ruby objects, the authors decided to allow access to the original Ruby classes by using a different syntax.[5] For this reason, Fancy can be extended easily to use Ruby libraries, or any of the C-extensions that are native to Ruby. Recently, a Ruby Gem was released for automated installation of the language.[6]
Christopher Bertels is a Computer Science and Philosophy student at the University of Osnabruck in Germany.[7] He has been working on the Fancy language for around a year, and has spoken about Fancy at the 2010 Ruby and Rails European conference[4] and the Emerging Languages Camp at OSCON.[8][9]
The implementation of the current release is a runtime using the Rubinius virtual machine, meaning that the language is running on the same platform as Ruby, and is accompanied by a self-hosted (bootstrapped compiler) that generated Rubinius bytecode. To allow more simple cross-platform development, nearly all of the standard library is written in Fancy itself.[10]
Description | Syntax |
---|---|
Simple print |
"hello world!" println |
Looped print 5 times |
5 times: { "hello world!" println } |
Calling methods |
var method1: param1 . method2 |
Calling Ruby methods |
var ruby_method1(param1) ruby_method2() |
Class Definitions |
class Person { read_write_slots: ['name, 'age, 'country] "Creates a new Person instance with the given name, age and country." p = Person new p name: name p age: age p country: country p } |
Nested classes |
class Outer { class Inner { class InnerMost { def football { "football" } } } } instance = Outer Inner InnerMost new instance football println |